import request from '@/utils/request'

const api = {
  getAllMeasdocUrl: '/base_measdoc/get_all_measdoc',
  getMeasdocPageUrl: '/base_measdoc/get_measdoc_page',
  addMeasdocUrl: '/base_measdoc/add_measdoc',
  updateMeasdocUrl: '/base_measdoc/update_measdoc',
  removeMeasdocUrl: '/base_measdoc/remove_measdoc',
}

export async function getAllMeasdocApi(params: Map<string, any>) {
  const res = await request({
    url: api.getAllMeasdocUrl,
    method: 'get',
    params: params,
  })
  return res
}

export async function getMeasdocPageApi(params: Map<string, any>) {
  const res = await request({
    url: api.getMeasdocPageUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function addMeasdocApi(params: Map<string, any>) {
  const res = await request({
    url: api.addMeasdocUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function updateMeasdocApi(params: Map<string, any>) {
  const res = await request({
    url: api.updateMeasdocUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function removeMeasdocApi(params: Map<string, any>) {
  const res = await request({
    url: api.removeMeasdocUrl,
    method: 'get',
    params: params,
  })
  return res
}
